package day_01;

import java.io.File;
import java.io.IOException;

public class File_IO {
    public static void main(String[] args) {
        File file = new File(".\\2.txt");
        try {
            file.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(file.exists());
        System.out.println(file.isFile());
        System.out.println(file.isDirectory());
        System.out.println("相对路径:"+file.getPath());
        System.out.println("绝对路径:"+file.getAbsoluteFile());
        System.out.println("文件名:"+file.getName());
        System.out.println("字节数:"+file.length());

    }

}
